//*********************************************************************
//		Copyright (c) 2003 - 2008 Microsoft Corporation.
//      This code is provided under Microsoft Public License, which can be found at
//      http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.mspx 
//
// @File: Connection.cs
//
// Purpose: SQL Conneciton
//
//
//
// Notes: 
//
//
//	
// History: 
//     @Version: V2.1
//
//     08/18/08 PGV 2.1.001.0 Starting V2.1 (based on 2.0.030.0 code)
//
// @EndHeader@
//*********************************************************************

using System;
using System.Data;
using System.Data.SqlClient;

namespace H2V2.ConfigUtility
{
	public class Connection 
	{
		SqlConnection m_Connection;
		public SqlConnection SQLConnection { get {return m_Connection;} }
		string m_server;

		public Connection (string a_ServerName) 
		{
			m_server = a_ServerName;

			string ConnectionString = "server="+a_ServerName+";Trusted_Connection=true;";
			m_Connection = new SqlConnection (ConnectionString);
			m_Connection.Open ();
		}

		public Connection (string a_ServerName, string a_User, string a_Pwd)
		{
			m_server = a_ServerName;

			string ConnectionString = "server="+a_ServerName+";User ID="+a_User+";Pwd=a_Pwd;";
			m_Connection = new SqlConnection (ConnectionString);
			m_Connection.Open ();
		}
		
		public void Close ()
		{
			m_Connection.Close ();
		}
	}

}
